//-----------------------------------------------------------------------
//<copyright file="NhaCungCapBLL.cs
//Code gen by tool.
//</copyright>
//-----------------------------------------------------------------------
using System;
using PMS.Exceptions;
using System.Collections.Generic;
using PMS.DAL;
using PMS.Entity;

namespace PMS.BLL
{
	public class NhaCungCapBO : BaseBO
	{
		// Interface Instant Object
		private readonly INhaCungCapDAO nhacungcapInterfaceObject = null;

		// Constructor
		public NhaCungCapBO()
		{
			nhacungcapInterfaceObject = new DAL.ServiceFactory<INhaCungCapDAO>().CurrentDAL;
		}

		#region NhaCungCap

		/// <summary>
		///
		/// </summary>
		/// <param name="nhacungcap"></param>
		public NhaCungCap CreateNhaCungCap(NhaCungCap nhacungcap)
		{
			try
			{
				return nhacungcapInterfaceObject.CreateNhaCungCap(nhacungcap);
			}
			catch (Exception ex)
			{
				throw BusinessException.GetException("Business Access CreateNhaCungCap Exception", ex);
			}
		}

		/// <summary>
		///
		/// </summary>
		/// <param name="nhacungcap"></param>
		public void UpdateNhaCungCap(NhaCungCap nhacungcap)
		{
			try
			{
				nhacungcapInterfaceObject.UpdateNhaCungCap(nhacungcap);
			}
			catch (Exception ex)
			{
				throw BusinessException.GetException("Business Access UpdateNhaCungCapException", ex);
			}
		}

		/// <summary>
		///
		/// </summary>
		/// <param name="nhacungcap"></param>
		public void DeleteNhaCungCap(NhaCungCap nhacungcap)
		{
			try
			{
				nhacungcapInterfaceObject.DeleteNhaCungCap(nhacungcap);
			}
			catch (Exception ex)
			{
				throw BusinessException.GetException("Business Access DeleteNhaCungCapException", ex);
			}
		}

		/// <summary>
		///
		/// </summary>
		public NhaCungCaps GetAllNhaCungCap()
		{
			try
			{
				return nhacungcapInterfaceObject.GetAllNhaCungCap();
			}
			catch (Exception ex)
			{
				throw BusinessException.GetException("Business Access GetAllNhaCungCap Exception", ex);
			}
		}

		/// <summary>
		///
		/// </summary>
		/// <param name="maNCC"></param>
		public NhaCungCap GetNhaCungCapByID(string maNCC)
		{
			try
			{
				return nhacungcapInterfaceObject.GetNhaCungCapByID(maNCC);
			}
			catch (Exception ex)
			{
				throw BusinessException.GetException("Business Access GetNhaCungCapBy ID Exception", ex);
			}
		}

		#endregion
	}
}
